[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
_exit() Terminate Process without Cleanup
#include <process.h>
#include <stdlib.h>
void _exit(status);
int status; Exit status
_exit() terminates the calling process and returns the low-byte of
'status' (status & 0xFF) to the waiting parent process, if one
exists. Functions registered with atexit() are NOT executed, files
are not closed, and stream buffers are not flushed.
Returns: There is no return value; _exit() does not return to
the calling process. 'status' is returned to the
parent process. (The parent process is usually the
operating system.)
Notes: exit() has a similar function to _exit(), but does
flush stream buffers, close files, and execute
functions registered with atexit() before
terminating.
-------------------------------- Example ---------------------------------
The following statements set the exit status to 1 if more than one
command line argument is passed.
#include <stdio.h> /* for 'printf' */
#include <stdlib.h> /* for '_exit' (also in <process.h>) */
main(argc, argv)
int argc;
char *argv[];
{
if (argc > 2) {
perror("no more than 1 command line parameter allowed\n");
_exit(1); /* exit immediately */
}
/* exit normally here with a status of 0 */
}
See Also:
exit()
abort()
exec...()
spawn...()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson